﻿namespace Hopfield.Simulator
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Globalization;
    using System.Text;
    using System.Windows.Forms;    

    public partial class ChartForm : Form
    {
        public ChartForm()
        {
            InitializeComponent();
        }

        public void AddValue(float value)
        {
            if (mainChart.Series[0].Points.Count == 0
                && value > 0.0f)
            {
                mainChart.ChartAreas[0].AxisY.Maximum = value;
            }

            mainChart.Series[0].Points.Add(value);
        }

        public void ClearValues()
        {
            mainChart.Series[0].Points.Clear();
        }

        public void SetValuesName(string name)
        {
            this.Text = string.Format(CultureInfo.InvariantCulture, "Chart {0} values.", name);
        }
    }
}
